package com.yingsheng.bi.hks.web.controller;

import com.yingsheng.bi.hks.dto.categories.*;
import com.yingsheng.bi.hks.feign.client.CategoriesFeignClient;
import com.yingsheng.bi.hks.service.categories.CategoriesMgmtService;
import com.yingsheng.bi.hks.template.annotation.Template;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RestController;

/**
 * 分类信息管理
 *
 * @author 83686
 */
@RestController
public class CategoriesCtrl implements CategoriesFeignClient {

    @Autowired
    private CategoriesMgmtService categoriesMgmtService;

    @Template(name = "accessTransTemplate")
    @Override
    public CategoriesAddRes add(@Validated CategoriesAddReq req) {
        return categoriesMgmtService.add(req);
    }

    @Template(name = "accessTransTemplate")
    @Override
    public CategoriesModRes mod(@Validated CategoriesModReq req) {
        return categoriesMgmtService.mod(req);
    }

    @Template(name = "publicQueryTemplate")
    @Override
    public CategoriesQryRes qry(@Validated CategoriesQryReq req) {
        return categoriesMgmtService.qry(req);
    }

    @Template(name = "accessTransTemplate")
    @Override
    public CategoriesDelRes del(@Validated CategoriesDelReq req) {
        return categoriesMgmtService.del(req);
    }
}
